package com.sptpc.learnspring.model;

import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * CateGory
 * database:drinksdatabase
 * data:2020/3/2 12:22 上午
 *
 * Axmaster
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "t_category")
@Data
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Category extends BaseEntity implements Serializable {
    private String name;
    @OneToMany(mappedBy = "category")
    private List<Drink> drinks;

    @Override
    public String toString() {
        return "Category{" +
                "name='" + name + '\'' +
                "} " + super.toString();
    }
}
